package edu.mju.service.impl;

import edu.mju.dao.impl.ScenicSpotDaoImpl;
import edu.mju.entity.ScenicSpot;
import edu.mju.service.ISpotListService;
import edu.mju.util.Pager;

import java.util.List;

/**
 * @Author:wyp
 * @Date:2020/5/11 13:50
 */
public class SpotListServiceImpl implements ISpotListService {
    private ScenicSpotDaoImpl scenicSpotDaoImpl = new ScenicSpotDaoImpl();

    @Override
    public boolean update(ScenicSpot scenicSpot) {
        boolean uodateT = scenicSpotDaoImpl.update(scenicSpot);
        return uodateT;
    }

    @Override
    public List<ScenicSpot> findAll(){
        List<ScenicSpot> list = scenicSpotDaoImpl.findAll();
        return list;
    }

    @Override
    public ScenicSpot findBySpotId(Integer spotId) {
        ScenicSpot scenicSpot = scenicSpotDaoImpl.findById(spotId);
        return scenicSpot;
    }

    @Override
    public Pager pagernate(int page, int pageSize,ScenicSpot scenicSpot) {
        Pager pager = scenicSpotDaoImpl.pagenate(page,pageSize,scenicSpot);
        return pager;
    }
}
